package com.example.xd.javatest.proxy_test;

/**
 * @auther XuDan on 2020/6/15.
 */
public class StaticProxy implements Sing {
    private RealSinger mSinger;

    public StaticProxy(RealSinger singer) {
        mSinger = singer;
    }

    private void singPre() {
        System.out.println("代理处理唱歌之前的事情");
    }

    @Override
    public void sing(String name) {
        singPre();
        mSinger.sing(name);
        singAfter();
    }

    private void singAfter() {
        System.out.println("代理畜类唱歌之后的事情");
    }
}
